package com.only4play.productcenter.api.constants;

import com.only4play.common.constants.BaseEnum;

import java.util.Optional;

/**
 * @author hinzzz www.hinzzz.cn 157957329@qq.com
 * 2024-02-28
 */
public enum TemplateType implements BaseEnum<TemplateType> {

    PRODUCT(1, "产品"),
    WORKFLOW(1, "工作流"),
    QUESTION(1, "问卷"),

    ;

    private final Integer code;
    private final String name;
    TemplateType(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static Optional<TemplateType> of(Integer code) {
        return Optional.ofNullable(BaseEnum.parseByCode(TemplateType.class, code));
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getName() {
        return this.name;
    }

}
